package net.socket;

import java.net.InetAddress;
import java.net.Socket;

public class HighPortScanner
{
	public static void main(String[] args)
	{
		String host = "localhost";
		if(args.length>0)
		{
			host=args[0];
		}
		try
		{
			InetAddress theAddress = InetAddress.getByName(host);
			for (int i = 1024; i < 65536; i++)
			{
				try
				{
					@SuppressWarnings("unused")
					Socket theSocket = new Socket(theAddress, i);
					System.out.println("there is a socket on port"+i+host);
				}
				catch (Exception e)
				{
					continue;
				}
			}
		}
		catch (Exception e)
		{
			// TODO: handle exception
		}
	}
}
